package ${package}.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.web.bind.annotation.*;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.*;
import javax.annotation.Resource;

import com.neusoft.jn.sys.common.core.domain.AjaxResult;
import com.neusoft.jn.sys.common.utils.poi.ExcelUtil;
import com.neusoft.jn.sys.common.annotation.Log;
import com.neusoft.jn.sys.common.enums.BusinessType;
import ${package}.entity.${TableName};
import ${package}.service.${TableName}Service;
import com.neusoft.jn.sys.common.core.page.TableDataInfo;

import org.springframework.stereotype.Controller;
import com.neusoft.jn.common.base.BaseController;

/**
* ${tableComment!}
* @author mengshx
* @since 2024-07-11
*/
@Controller
@RequestMapping("/${tableName}")
public class ${TableName}RouterController extends BaseController {
    private String prefix = "${tableName}";
    @Resource
    private ${TableName}Service service;

    /**
     * 路由查看列表页面
     **/
    @GetMapping()
    public String orgTreePlan()
    {
        return prefix + "/index";
    }
    /**
     * 路由添加页面
     */
    @GetMapping("/add")
    public String add()
    {
        return prefix + "/add";
    }

    /**
     * 路由修改页面
     */
    @GetMapping("/edit/{id}")
    public String edit(@PathVariable("id") String id, ModelMap mmap)
    {
        ${TableName} ${tableName} = service.getById(id);
        mmap.put("viewObject", ${tableName});
        return prefix + "/edit";
    }
    /**
     * 查看详情
     */
    @GetMapping("/view/{id}")
    public String view(@PathVariable("id") String id, ModelMap mmap)
    {
        ${TableName} ${tableName} = service.getById(id);
        mmap.put("viewObject", ${tableName});
        return prefix + "/detail";
    }


}

